/* eslint-disable indent */
import request from '../utils/request'

/** 文章接口**/
// 分页查询
export function articlePageList (params) {
    return request({
        url: '/api/v1/article/pageList',
        method: 'get',
        params
    })
}

// 条件查询
export function articleQueryList (params) {
    return request({
        url: '/api/v1/article/queryList',
        method: 'get',
        params
    })
}

// 浏览排行
export function articleQueryScanRankList (params) {
    return request({
        url: '/api/v1/article/queryScanRankList',
        method: 'get',
        params: {
            limit: params.limit
        }
    })
}

// 详情
export function articleDetail (params) {
    return request({
        url: '/api/v1/article/detail',
        method: 'get',
        params: {
            id: params.id
        }
    })
}

/** 文章分类接口 */
// 分页查询
export function articleCategoryPageList (params) {
    return request({
        url: '/api/v1/article/category/pageList',
        method: 'get',
        params
    })
}

// 列表查询
export function articleCategoryQueryList (params) {
    return request({
        url: '/api/v1/article/category/queryList',
        method: 'get',
        params
    })
}

// 保存
export function articleCategorySave (parms) {
    return request({
        url: '/api/v1/article/category/save',
        method: 'post',
        data: {
            name: parms.name,
            enabled: parms.enabled
        }
    })
}

// 修改
export function articleCategoryUpdate (parms) {
    return request({
        url: '/article/article/category/update',
        method: 'post',
        data: {
            id: parms.id,
            name: parms.name,
            enabled: parms.enabled
        }
    })
}

// 删除
export function articleCategoryDeletes (parms) {
    return request({
        url: '/article/article/category/deletes',
        method: 'post',
        data: parms
    })
}
